home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
komunikace
/
maxthon
/
mcombo.exe
/
Plugin
/
Techorati Sidebar
/
scripts
/
pageScript.js
< prev
next >
Wrap
Text File
|
2006-09-08
|
3KB
|
119 lines
/**************************
Technorati Sidebar
By Neo101
Version 1.0.0
**************************/
function clickTab(activeTabNumber){
var nodes = document.getElementsByTagName('div');
for(var i=0; i<nodes.length; i++){
if(nodes[i].id.indexOf('data') == 0){
nodes[i].style.display = 'none'
}
}
var nodes = document.getElementsByTagName('span');
for(var i=0; i<nodes.length; i++){
if(nodes[i].id.indexOf('tab') == 0){
nodes[i].className = 'unselected-tab'
}
}
document.getElementById("tab" + activeTabNumber).className = 'selected-tab'
document.getElementById("data" + activeTabNumber).style.display = 'block'
if(activeTabNumber == 1){
document.getElementById('keywords').select()
}
}
function expandCollapse( elementId ){
var nextElement = document.getElementById(elementId)
if(nextElement.style.display == 'none'){
nextElement.style.display = 'block'
var show = true
}
else{
nextElement.style.display = 'none'
var show = false
}
if(elementId == 'showAdvanced'){
setAdvancedText(show)
}
}
function setAdvancedText(show){
var text
if(show){
text = 'Hide Advanced Options'
} else {
text = 'Show Advanced Options'
}
document.getElementById('advanced').innerHTML = text
}
function showLink(link){
external.get_tab(SECURITY_ID, external.cur_sel).window.status = link
}
function hideLink(){
external.get_tab(SECURITY_ID, external.cur_sel).window.status = ''
}
function currentSite(){
var url = external.get_tab(SECURITY_ID, external.cur_sel).document.URL
if(url.substring(0,4)=='file'){
showError('not a valid URL')
return
}
document.getElementById('url').value = url.replace(/http:\/\/(www\.)?/i,'').replace(/\/$/,'')
blogInfoSearch()
}
function currentSiteDomainOnly(){
var url = document.getElementById('url').value
document.getElementById('url').value = url.replace(/http:\/\/(www\.)?/i,'').replace(/\/.*/,'')
blogInfoSearch()
}
function toggleAutoRefresh(){
if(enableInterval == '1'){
enableInterval = '0'
} else {
enableInterval = '1'
}
writeSetting('enableInterval', enableInterval)
setAutoUpdateText()
}
function saveSelect(element){
var newValue = element.value
var id = element.id
writeSetting(id, newValue)
}
function addToFavorites(){
var url = external.get_tab(SECURITY_ID, external.cur_sel).document.URL
var favUrl = 'http://www.technorati.com/faves?add='+escape(url)
external.m2_callerName(SECURITY_ID, PLUGIN_NAME)
window.open(favUrl)
}